//
//  XLGetAwardSheetView.m
//  XiangLove
//
//  Created by 李传坤 on 2018/3/27.
//  Copyright © 2018年 BAOMIHUA.COM. All rights reserved.
//

#import "XLGetAwardSheetView.h"
#import "UIImage+Gradient.h"

@implementation XLGetAwardSheetView

+ (instancetype)initXLGetAwardSheetView{
    NSArray *nib = [[NSBundle mainBundle]loadNibNamed:@"XLGetAwardSheetView" owner:nil options:nil];
    return [nib objectAtIndex:0];
}
- (void)awakeFromNib {
    _sureButton1.layer.cornerRadius = 25;
    _sureButton1.layer.masksToBounds = YES;
    self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    [super awakeFromNib];
}
-(void)show{
    [_sureButton1 setBackgroundColor:RGB_HEX(0xFFBB01)];
    self.alpha = 0;
    if (_jifenLabel.text.length == 0) {
        _jifenTop.constant = 50;
    }
    [[[[UIApplication sharedApplication]delegate]window]addSubview:self];
    [UIView animateWithDuration:0.1 animations:^{
        self.alpha = 1;
    }completion:^(BOOL finished) {
        
    }];
}
-(void)dissmiss{
    [UIView animateWithDuration:0.3 animations:^{
        self.alpha = 0;
    }completion:^(BOOL finished) {
        [self removeFromSuperview];
    }];
}

- (IBAction)sureButton:(id)sender {
    _block();
    [self dissmiss];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
